import { defHttp } from '/@/utils/http/axios';
import { IPostBrandUpdateRaw } from '/@/types/system/auxiliary/brand/update';
import { IPostBrandDeleteRequest } from '/@/types/system/auxiliary/brand/delete';
import { IPostBrandListRequest, IPostBrandListResponse } from '/@/types/system/auxiliary/brand/list';
import { IGetRawBrandDetailsResponse } from '/@/types/system/auxiliary/brand/details';
import { IPostBrandAddRequest } from '/@/types/system/auxiliary/brand/add';
import { IPostBrandCheckCodeUniqueQuery } from '/@/types/system/auxiliary/brand/checkCodeUnique';

/**
 * 修改品牌
 */
export const apiPostBrandUpdatePath = (id: string | number, params: IPostBrandUpdateRaw) =>
  defHttp.post({ url: `/system/auxiliary/brand/update/${id}`, params });
/**
 * 删除品牌
 */
export const apiPostBrandDelete = (params: IPostBrandDeleteRequest) => defHttp.post({ url: `/system/auxiliary/brand/delete`, params });
/**
 * 品牌列表
 */
export const apiPostBrandList = (params: IPostBrandListRequest) =>
  defHttp.post<IPostBrandListResponse>({ url: `/system/auxiliary/brand/list`, params });
/**
 * 品牌详情
 */
export const apiGetBrandDetailsPath = (id: string | number) =>
  defHttp.get<IGetRawBrandDetailsResponse>({ url: `/system/auxiliary/brand/details/${id}` });
/**
 * 新增品牌
 */
export const apiPostBrandAdd = (params: IPostBrandAddRequest) => defHttp.post({ url: `/system/auxiliary/brand/add`, params });
/**
 * 校验品牌编码是否唯一
 */
export const apiPostBrandCheckCodeUniqueQuery = (params: IPostBrandCheckCodeUniqueQuery) =>
  defHttp.postForm({ url: `/system/auxiliary/brand/checkCodeUnique`, params });
